"""Styles for the app."""
import nextpy as xt

border_radius = "0.375rem"
box_shadow = "0px 0px 0px 1px rgba(84, 82, 95, 0.14)"
border = "1px solid #F4F3F6"
text_color = "black"
accent_text_color = "#fffff"
accent_color = "blue"
hover_accent_color = {"_hover": {"color": accent_color}}
hover_accent_bg = {"_hover": {"bg": accent_color}}
content_width_vw = "90vw"
sidebar_width = "20em"

template_page_style = {"padding_x": ["auto", "2em"], "flex": "1", "width": "70vw"}

template_content_style = {
    "align_items": "flex-start",
    "box_shadow": box_shadow,
    "border_radius": border_radius,
    "padding": "1em",
    "margin_bottom": "2em",
}

link_style = {
    "color": text_color,
    "text_decoration": "none",
    **hover_accent_color,
}

overlapping_button_style = {
    "background_color": "white",
    "border": border,
    "border_radius": border_radius,
}

base_style = {
    xt.MenuButton: {
        "width": "3em",
        "height": "3em",
        **overlapping_button_style,
    },
    xt.MenuItem: hover_accent_bg,
}

markdown_style = {
    "code": lambda text: xt.code(text, color="#1F1944", bg="#EAE4FD"),
    "a": lambda text, **props: xt.link(
        text,
        **props,
        font_weight="bold",
        color="#AD9BF8",
        text_decoration="underline",
        text_decoration_color="#AD9BF8"
    ),
}
